package com.ruoyi.system.wnjk.producer;

import com.ruoyi.system.pay.domain.po.OrderQuery;
import com.ruoyi.system.wnjk.config.DirectExchangeConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 死信队列生产者，用于解决掉单
 */
@Service
public class DirectProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendRequest(OrderQuery orderQuery) {
        rabbitTemplate.convertAndSend(DirectExchangeConfig.DIRECT_EXCHANGE,
                DirectExchangeConfig.DIRECT_ROUTING_KEY, orderQuery);
    }
}
